package com.mathdroid.model.items;

import java.io.Serializable;

/**
 * This is a filter for the item browser. The source of an item has a name and
 * an icon. The filter can be enabled or disabled.
 */
public final class SourceCondition implements Serializable {
	
	/**
	 * Generated UID.
	 */
	private static final long serialVersionUID = -1998248964221210998L;
	
	/**
	 * The name of the item source.
	 */
	private String source = null;
	
	/**
	 * If this filter is enabled or disabled.
	 */
	private boolean enabled = true;
	
	/**
	 * The name of the icon for the item source.
	 */
	private String icon = null;
	
	/**
	 * Create a new source filter.
	 * @param s The name of the source.
	 * @param b If the filter is enabled.
	 * @param i The name of the icon.
	 */
	public SourceCondition(final String s, final boolean b, final String i) {
		this.source = s;
		this.enabled = b;
		this.icon = i;
	}

	/**
	 * Get the name of the source.
	 * @return Source name.
	 */
	public String getSource() {
		return this.source;
	}

	/**
	 * If this filter is enabled.
	 * @return If the filter is enabled. 
	 */
	public boolean isEnabled() {
		return this.enabled;
	}

	/**
	 * Set if this filter is enabled.
	 * @param e If this filter is enabled.
	 */
	public void setEnabled(final boolean e) {
		this.enabled = e;
	}

	/**
	 * Get the icon name of the source.
	 * @return Icon name of the source.
	 */
	public String getIcon() {
		return this.icon;
	}
}
